#ifndef UTILS_H
#define UTILS_H

#include <chrono>

namespace tbp {

// 计时器
class Timer {
private:
  std::chrono::steady_clock::time_point start_time_;
  std::chrono::steady_clock::time_point end_time_;

public:
  inline void start() { start_time_ = std::chrono::steady_clock::now(); }
  inline void end() { end_time_ = std::chrono::steady_clock::now(); }
  inline long long GetTimeConsuming() {
    return std::chrono::duration_cast<std::chrono::milliseconds>(end_time_ -
                                                                 start_time_)
        .count();
  }
};

} // namespace TBP
#endif